import 'package:json_annotation/json_annotation.dart';

part 'hot_today_model.g.dart';

@JsonSerializable()
class HotTodayModel {
  final String? reason;
  final Result? result;
  @JsonKey(name: 'error_code')
  final int? errorCode;

  const HotTodayModel({
    this.reason,
    this.result,
    this.errorCode,
  });

  factory HotTodayModel.fromJson(Map<String, dynamic> json) =>
      _$HotTodayModelFromJson(json);

  Map<String, dynamic> toJson() => _$HotTodayModelToJson(this);
}

@JsonSerializable()
class Result {
  final List<HotList>? list;

  const Result({
    this.list,
  });

  factory Result.fromJson(Map<String, dynamic> json) =>
      _$ResultFromJson(json);

  Map<String, dynamic> toJson() => _$ResultToJson(this);
}

@JsonSerializable()
class HotList {
  final String? title;
  final int? hotnum;
  final String? digest;

  const HotList({
    this.title,
    this.hotnum,
    this.digest,
  });

  factory HotList.fromJson(Map<String, dynamic> json) =>
      _$HotListFromJson(json);

  Map<String, dynamic> toJson() => _$HotListToJson(this);
}
